<script language="javascript" src="<?php echo JQUERYUI?>jquery.ui.mouse.min.js"></script>
<script language="javascript" src="<?php echo JQUERYUI?>jquery.ui.draggable.min.js"></script>
<script language="javascript" src="<?php echo JQUERYUI?>jquery.ui.position.min.js"></script>
<script language="javascript" src="<?php echo JQUERYUI?>jquery.ui.resizable.min.js"></script>
<script language="javascript" src="<?php echo JQUERYUI?>jquery.ui.dialog.min.js"></script>
<script>
$(document).ready(function() {
    $( ".date" ).datepicker();
	$( ".date" ).datepicker( "option", "dateFormat", "dd-mm-yy");
	$( "#tgl_awal" ).change(function(){
			location.href = "<?php echo SOPIR ?>list_result/"+$('#tgl_awal').val()+"/"+$('#tgl_akhir').val();
	});
	$( "#tgl_akhir" ).change(function(){
			location.href = "<?php echo SOPIR ?>list_result/"+$('#tgl_awal').val()+"/"+$('#tgl_akhir').val();
	});
	list_table = $('#list_laporan_supir').dataTable({
			"bFilter" : true,
			"bJQueryUI" : true,
			"aLengthMenu": [[10,25,50, 100, -1], [10,25,50,100, "Semua"]],
			"sPaginationType": "full_numbers",
			"oLanguage": {
				"sLengthMenu": "Menampilkan _MENU_ data",
				"sZeroRecords": "Belum ada data penerimaan kasir yang tersimpan",
				"sInfoFiltered": "(Hasil filter dari _MAX_ yang didapat)"
			}
		});
		$('#list_laporan_sopir_filter').hide();
		
	$( "#cetak_pdf" ).click(function(){
		tgl_awal = $( "#tgl_awal" ).val();
		tgl_akhir = $( "#tgl_akhir" ).val();
		location.href="<?php echo SOPIR?>cetak_pdf/"+tgl_awal+"/"+tgl_akhir;
	});
	$( "#cetak_excel" ).click(function(){
		tgl_awal = $( "#tgl_awal" ).val();
		tgl_akhir = $( "#tgl_akhir" ).val();
		location.href="<?php echo SOPIR?>cetak_excel/"+tgl_awal+"/"+tgl_akhir;
	});
} );
</script>
<?php
$data['cur_parent_menu']='laporan';
$data['cur_selected_menu']='sopir';
$this->load->view('template/menu_view',$data);
?>
<br/><br/><br/><br/><br/><br/>
<table width="1000" align="center">
	<tr>
		<td width="500">
			&nbsp;
		</td>
		<td width="500" align="left">
			Tgl Awal : <input type="text" class="date" id="tgl_awal" value="<?php echo $tgl_awal?>"/>
			Tgl Akhir : <input type="text" class="date" id="tgl_akhir" value="<?php echo $tgl_akhir?>"/>
		</td>
	</tr>
</table>
<br/>
Cetak : <span class="clicked" id="cetak_pdf">PDF</span> <span class="clicked" id="cetak_excel">Excel</span>
<br/>
<table id="list_laporan_supir" width="100%" align="center" border="0">
	<thead>
		<tr>
			<th>No</th>
			<th>Nama Sopir</th>
			<th>Total Hari Kerja</th>
			<th>Total Keberangkatan</th>
			<th>Total Tiket</th>
			<th>Total Tiket Void</th>
			<th>Total Omset</th>
			<th>Produktivitas</th>
                        <th>Action</th>
		</tr>
	</thead>
	<tbody>
		<?php 
                for($i=0;$i<count($list_result);$i++){?>
		<tr>
			<td><?php echo ($i+1)?></td>
			<td><?php echo $list_result[$i]['driver']?></td>
			<td><?php echo $hari[$i]?></td>
			<td><?php echo $jumlah_keberangkatan[$i]['jumlah_keberangkatan']?></td>
			<td><?php echo $setoran[$i]['total_penumpang']?></td>
			<td><?php echo $setoran[$i]['tiket_void']?></td>
			<td><?php echo $setoran[$i]['total_omset']?></td>
			<td><?php echo ($setoran[$i]['total_penumpang']/$setoran[$i]['total_kapasitas'])?></td>
                        <td align="center">
                            <a href="<?php echo SOPIR ?>grafik_harian_produk_driver/<?php echo $list_result[$i]['driver']?>">Grafik Produktivitas Bulanan</a>|
                            <a href="<?php echo SOPIR ?>grafik_bulanan_produk_driver/<?php echo $list_result[$i]['driver']?>">Grafik Produktivitas Tahunan</a></td>
		</tr>
		<?php }
                ?>
	</tbody>
</table>